<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../lib/vue.js"></script>
</head>
<body>
    <div id="app">
        <form action="https://www.baidu.com/s">
            <label>
                <input type="text" name="wd">
            </label>
            <button @click.once="search">搜索</button>
        </form>
    </div>
</body>
<script>
    // once:事件只会作用一次
    new Vue({
        el:"#app",
        methods:{
            search(e){
                e.preventDefault();
                alert(1);
            }
        }
    })
</script>
</html>